using UnityEngine;

public class jetpackPartickleMagick : MonoBehaviour
{
	public ParticleSystem leftParticle;

	public ParticleSystem rightParticle;

	private void OnEnable()
	{
		if (IsInitParticle())
		{
			leftParticle.Simulate(Time.unscaledDeltaTime, false, true);
			rightParticle.Simulate(Time.unscaledDeltaTime, false, true);
		}
	}

	private bool IsInitParticle()
	{
		return leftParticle != null && rightParticle != null;
	}

	public void Intit()
	{
		if (IsInitParticle())
		{
			leftParticle.Simulate(Time.unscaledDeltaTime, false, true);
			rightParticle.Simulate(Time.unscaledDeltaTime, false, true);
		}
	}

	private void Update()
	{
		if (IsInitParticle())
		{
			leftParticle.Simulate(Time.unscaledDeltaTime, false, false);
			rightParticle.Simulate(Time.unscaledDeltaTime, false, false);
		}
	}

	private void OnDisable()
	{
		if (IsInitParticle())
		{
			leftParticle.Stop();
			rightParticle.Stop();
		}
	}
}
